
function set(type, value) {
    localStorage.setItem(type, value);
}
function get(type) {
    return localStorage.getItem(type);
}
function get(type) {
    if (type === "token") {
        let token = localStorage.getItem(type);
        if(token==null){
            return layer.alert("身份过期，是否重新登录！", {
                title: '身份过期',
                btn: ['确定'],
                icon: 5,
                closeBtn: 1,
                anim:1
            }, function(){
                layer.msg('正在跳转请稍等',{anim: 1,offset:"t"});
                setTimeout(function () {
                    if (parent == window) {
                        location.href = "../login.html";
                    }
                }, 500);
            });
        }
    }
    return localStorage.getItem(type);
}

function remove(type) {
    localStorage.removeItem(type);
}
/* 获取主机地址和端口号 */
const url = window.location.host;